﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SelectCarInfo.aspx.cs"
    Inherits="Portal.SelectCarInfo" %>

<base target="_self" />
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title></title>
    <link rel="Stylesheet" href="../../App_Themes/formValidator2.5/css/validationEngine.jquery.css" />
    <script src="js/jquery.js" type="text/javascript"></script>
    <script type="text/javascript" src="../../js/My97DatePicker/WdatePicker.js"></script>
    <script type="text/javascript" language="javascript">
        $().ready(function () {
            $("span[id*='lbCarnumber']").each(function () {
                $(this).click(function () {
                    CarDetail($(this).parent().find("[id*='hfid']").val());
                    //$("#CarName").val($(this).text().toString());
                    $("#CarName").val($(this).parent().parent().parent().find("td:eq(0)").text().toString());
                    $("#CarId").val($(this).parent().find("[id*='hfid']").val().toString());
                });
            });
        });
        function CarDetail(obj) {
            //            return false;
            // alert($(obj).parent.find("id$=hfid").val());
            $.ajax({
                type: "post",
                url: "SelectCar.ashx?id=" + obj,
                // contentType: "application/json; charset=utf-8",
                // contentType: "text/plain;charset=utf-8",
                // dataType: "json",
                // data: "id=111",
                success: function (msg) {
                    // alert(msg);
                    $("#divCarDetail").html(msg);
                    $("#divCarDetail").css("display", "");
                    $("#dinMain").css("display", "none");
                }
            });

            //alert($("#ttt").html());
        }

        function Cancel() {
            $("#divCarDetail").css("display", "none");
            $("#dinMain").css("display", "");
        }

        function Sure() {
            var ReturnJson = "";
            ReturnJson = "{'CarName':'" + $("#CarName").val() + "',CarId:'" + $("#CarId").val() + "'}";
            window.returnValue = ReturnJson;
            window.close();
        } 
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div id="dinMain" runat="server">
        <table class="table table-hover table-bordered table-condensed listTable" style="width:830; margin:5% 1% 0 1%;
            overflow: hidden;">
            <thead>
                <tr class="banner">
                    <th style="font-size:14;font-weight:bold;">
                        车辆名称
                    </th>
                    <th style="font-size:14;font-weight:bold">
                        车牌号
                    </th>
                    <th style="font-size:14;font-weight:bold">
                        <asp:Label ID="Monday" runat="server" Text=""></asp:Label>
                    </th>
                    <th style="font-size:14;font-weight:bold">
                        <asp:Label ID="Tuesday" runat="server" Text=""></asp:Label>
                    </th>
                    <th style="font-size:14;font-weight:bold">
                        <asp:Label ID="Wednesday" runat="server" Text=""></asp:Label>
                    </th>
                    <th style="font-size:14;font-weight:bold">
                        <asp:Label ID="Thursday" runat="server" Text=""></asp:Label>
                    </th>
                    <th style="font-size:14;font-weight:bold">
                        <asp:Label ID="Friday" runat="server" Text=""></asp:Label>
                    </th>
                    <th style="font-size:14;font-weight:bold">
                        <asp:Label ID="Saturday" runat="server" Text=""></asp:Label>
                    </th>
                    <th style="font-size:14;font-weight:bold">
                        <asp:Label ID="Weekday" runat="server" Text=""></asp:Label>
                    </th>
                </tr>
            </thead>
            <tbody>
                <asp:Repeater ID="RepeaterCar" runat="server" OnItemCommand="RepeaterCar_ItemCommand">
                    <ItemTemplate>
                        <tr>
                            <td style="text-align:center;font-size:14;" >
                                <%# Eval("CARNAME")%>
                            </td>
                            <td style="text-align:center;font-size:14;" >
                                <%--<a href="CarDetailInfo.aspx?CarName=<%#Server.UrlEncode(Eval("CARNAME").ToString().Trim())%>&CarNum=<%#Server.UrlEncode(Eval("CARNUMBER").ToString().Trim())%>&ID=<%# Eval("ID")%>"
                                    target="_blank">
                                    <%#Eval("CARNUMBER")%></a>--%>
                                <span>
                                    <%--  <span>--%>
                                    <%-- <asp:Button ID="btnCarNo" Width="80%" CssClass="btn" runat="server" Text='<%#Eval("CARNUMBER")%>' />--%>
                                    <%--<asp:LinkButton ID="btnCarNo" CommandArgument='<%#Eval("ID")%>' Width="86%" runat="server"
                                        Text='<%#Eval("CARNUMBER")%>' OnClientClick="CarDetail(this);return false;" />--%>
                                    <asp:Label ID="lbCarnumber" runat="server" Text='<%#Eval("CARNUMBER")%>' Style="text-decoration: underline;
                                        color: Blue; cursor: pointer;"></asp:Label>
                                    <asp:TextBox ID="hfid" runat="server" Text='<%#Eval("ID") %>' Style="display: none;"></asp:TextBox>
                                </span>
                            </td>
                            <td style="text-align:center;font-size:14;">
                                <%# Eval("Monday")%>
                            </td>
                            <td style="text-align:center;font-size:14;">
                                <%# Eval("Tuesday")%>
                            </td>
                            <td style="text-align:center;font-size:14;">
                                <%# Eval("Wednesday")%>
                            </td>
                            <td style="text-align:center;font-size:14;">
                                <%# Eval("Thursday")%>
                            </td>
                            <td style="text-align:center;font-size:14;">
                                <%# Eval("Friday")%>
                            </td>
                            <td style="text-align:center;font-size:14;">
                                <%# Eval("Saturday")%>
                            </td>
                            <td style="text-align:center;font-size:14;">
                                <%# Eval("Weekday")%>
                            </td>
                        </tr>
                    </ItemTemplate>
                </asp:Repeater>
            </tbody>
        </table>
    </div>
    <div style="text-align: center; display: none;" id="divCarDetail" runat="server">
        <table class="table table-hover table-bordered table-condensed listTable" style="width: 545px;
            overflow: hidden;">
            <tr>
                <td>
                    车辆名称
                </td>
                <td>
                    <asp:Label ID="lblCarName" runat="server" Text=""></asp:Label>
                </td>
                <td>
                    车牌号
                </td>
                <td>
                    <asp:Label ID="lblCarNo" runat="server" Text=""></asp:Label>
                </td>
            </tr>
            <tr>
                <td>
                    车辆类型
                </td>
                <td>
                    <asp:Label ID="lblCarType" runat="server" Text=""></asp:Label>
                </td>
                <td>
                    可乘坐人数
                </td>
                <td>
                    <asp:Label ID="lblPeopleNum" runat="server" Text=""></asp:Label>
                </td>
            </tr>
            <tr>
                <td>
                    车辆识别代码
                </td>
                <td>
                    <asp:Label ID="lblCarId" runat="server" Text=""></asp:Label>
                </td>
                <td>
                    发动机号码
                </td>
                <td>
                    <asp:Label ID="lblEnginedID" runat="server" Text=""></asp:Label>
                </td>
            </tr>
            <tr>
                <td>
                    注册日期
                </td>
                <td colspan="3">
                    <asp:Label ID="lblRegisterDate" runat="server" Text=""></asp:Label>
                </td>
            </tr>
            <tr>
                <td>
                    车辆说明
                </td>
                <td colspan="3">
                    <asp:Label ID="lblCarRemark" runat="server" Width="89%" Text=""></asp:Label>
                </td>
            </tr>
        </table>
    </div>
    <asp:TextBox ID="CarId" runat="server" style="display:none;"></asp:TextBox>
    <asp:TextBox ID="CarName" runat="server" style="display:none;"></asp:TextBox>
    </form>
</body>
</html>
